package com.helei.web.controller;

import java.awt.image.BufferedImage;

/**
 * @author helei
 * @date 2025/9/17 14:33
 */
public class CaptchaGeneratorUtils {
    /**
     * 获取验证码
     *
     * @param codeLength 验证码长度
     * @return
     */
    public static String getCaptchaCode(int codeLength) {
        return CaptchaGenerator.generateCaptchaCode(codeLength);
    }

    /**
     * 生成登录图片验证码
     *
     * @param captchaCode 验证码
     * @return
     */
    public static BufferedImage generateCaptchaLoginImage(String captchaCode) {
        return CaptchaGenerator.generateCaptcha(captchaCode, 7, 50, 170, 70);
    }
}
